package cn.gov.cus.rmftquartz.liuxing;

import cn.gov.cus.rmftquartz.common.utils.ExceptionHelper;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.apache.log4j.Logger;

import java.util.List;
import java.util.Map;

/**
 * 解析json字符串。
 * @author wxming.
 * @date 2018/4/4.
 */
public class JsonUtils {
    private static Logger LOG = Logger.getLogger(JsonUtils.class);
    public static<E> E getJsonObject(String jsonData){
        E element = null;
        try{
            element = new Gson().fromJson(jsonData,new TypeToken<E>(){}.getType());
        }catch (Exception e){
            LOG.error("Json转换 "+ ExceptionHelper.getExMsg(e));
        }
        return element;
    }

    public static void main(String[] args){
        String jsonData="";
        List<Map<String,List<String>>> list = JsonUtils.getJsonObject(jsonData);
    }

}
